/**
 * Tests the Character class
 */
// $codepro.audit.disable numericLiterals
package javamonsters.tests; // $codepro.audit.disable packagePrefixNamingConvention

import static org.junit.Assert.assertEquals;

import java.math.BigDecimal;

import javamonsters.model.Character;
import javamonsters.model.Ship;


import org.junit.Test;

/**
 * @author wa
 * @author sami
 * @version 1.0
 * 
 * class for JUnit testing methods in Character class
 */
public class CharacterTest {
	
	/**
	 * sami's test remove credits
	 */
	@Test // $codepro.audit.disable disallowTestAnnotation
	public void testRemoveCredits() {
		final Ship ship = new Ship(Ship.ShipType.FLEA);
		
		final Character character = new Character("character", 4, 4, 
				4, 4, new BigDecimal(50), ship, "easy");
		
		character.removeCredits(new BigDecimal(30));
		assertEquals("Character credits != 20", new BigDecimal(20),
				character.getCredits());
		
		final Character character1 = new Character("character", 4, 4, 
				4, 4, new BigDecimal(50), ship, "easy");
		
		character1.addCredits(new BigDecimal(30));
		assertEquals("Character credits != 80", new BigDecimal(80),
				character1.getCredits());
		
		
		
	}
	
	/**
	 * CharacterTest toString
	 * @return the string representation
	 */
	@Override
	public String toString() {
		return "CharacterTest JUnit";
	}

}
